package com.maotai.llzhou.timetask;


import javax.annotation.Resource;

import cn.hellotrue.HelloTrueHY;

import com.maotai.llzhou.service.MaotaiService;
import com.maotai.llzhou.thread.MaoTaiRegisterThreadNJ;

/**
 * 注册
 */
public class MaotaiRegisterTask {

	@Resource(name = "maotaiService")
	private MaotaiService maotaiService;
	
	
	public MaotaiRegisterTask() {
//		if("".equals(HelloTrue.TOKEN)){
//			HelloTrue ht = new HelloTrue();
//			HelloTrue.TOKEN = ht.loginIn();
//		}
//		if("".equals(HelloTrueAX.TOKEN)){
//			HelloTrueAX ht = new HelloTrueAX();
//			HelloTrueAX.TOKEN = ht.loginIn();
//		}
//		if("".equals(HelloTrueHY.TOKEN)){
//			HelloTrueHY ht = new HelloTrueHY();
//			HelloTrueHY.TOKEN = ht.loginIn();
//		}
	}


	public void beginTask() {
		try {
			
//			JSONArray jArray = IPFactory.getIpAndPort();
//			JSONObject jj = (JSONObject) jArray.get(0);
//			String ipAndPort = jj.getString("ip") + ":"
//					+ jj.getString("port");
//			MaoTaiRegisterThreadAX ttAX = new MaoTaiRegisterThreadAX(maotaiService,HelloTrueAX.TOKEN,ipAndPort);
//			ttAX.start();
//			Thread.sleep(1000);
//			if(HelloTrueHY.TOKEN.contains("htm"))return;
//			MaoTaiRegisterThreadHY ttAX = new MaoTaiRegisterThreadHY(maotaiService,HelloTrueHY.TOKEN);
//			ttAX.start();
			MaoTaiRegisterThreadNJ tt = new MaoTaiRegisterThreadNJ(maotaiService);
			tt.start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
